Skip to content

Rails: Prefer Devise for Authentication #736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevepolitodesign
Copy link
Contributor

This might be controversial since we maintain Clearance, but I've
found that I've only been on projects that use Devise during my time at
thoughtbot.

Although Rails introduced an authentication generator, I feel that
Devise it still preferable for the following reasons:

  • It receives frequent security updates, whereas you're on your own with
    a generator.
  • It's widely adopted in the Rails community.
  • It has a rich ecosystem.

This might be controversial since we maintain [Clearance][], but I've
found that I've only been on projects that use Devise during my time at
thoughtbot.

Although Rails introduced an [authentication generator][], I feel that
Devise it still preferable for the following reasons:

- It receives frequent security updates, whereas you're on your own with
  a generator.
- It's widely adopted in the Rails community.
- It has a [rich ecosystem].

[Clearance]: https://github.com/thoughtbot/clearance
[authentication generator]: https://guides.rubyonrails.org/security.html#authentication
[rich ecosystem]: https://github.com/heartcombo/devise?tab=readme-ov-file#extensions
Comment on lines +135 to +136
- Prefer [Devise][] over the [authentication generator][], due to its wide
adoption, rich [ecosystem][], and security maintenance.
Copy link
Contributor

@vburzynski vburzynski May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Could this be expanded to cover the set of architectural characteristics and project needs which would indicate Devise being a better choice and what set would indicate one should use Clearance?
    • For example, a simple forms-over-data CRUD and simple REST based small Rails app might benefit more from Clearance. Clearance might support architectural characteristics like simplicity, maintainability, agility; as it's a more lightweight solution. It could also cost-less to implement if its feature set covers the needs of the app. Yet if an app is likely to expand beyond what Clearance can offer, the implementation team would need to weigh the cost of replacement or enhancing Clearance.
    • on the other hand, an app with architectural characteristics that prioritize upgradeability, extensibility, configurability, and leverageability/reuse might want to choose Devise. Devise comes with a long list of third party extensions and a larger feature set. It's more commonly used across Rails applications. That large feature set comes with some complexity and challenges, but it's more ubiquitous in the Rails community.
    • so there are tradeoffs to using one or the other.
  2. This guideline might also benefit from creating a "guideline page" to expound on the reasoning (including what's mentioned in the PR description).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants